
/*   CODE WRITTEN BY AI

Input to AI:
Write program to Find the largest of three numbers
*/

start:


// Find the largest of three integers

addi x1, x0, 42      // First number
addi x2, x0, 17      // Second number
addi x3, x0, 68      // Third number

cout << "LARGEST OF THREE NUMBERS" << endl;
cout << endl;
cout << "First number  = " << x1 << endl;
cout << "Second number = " << x2 << endl;
cout << "Third number  = " << x3 << endl;

add  x4, x1, x0      // Assume the first number is largest

bge  x4, x2, check3  // Keep x4 if x4 >= x2
add  x4, x2, x0      // Otherwise, x2 is larger

check3:
bge  x4, x3, done    // Keep x4 if x4 >= x3
add  x4, x3, x0      // Otherwise, x3 is larger

done:
cout << endl;
cout << "Largest number = " << x4 << endl;
